<?php
	//CREO LA BASE DE DATOS
	$dbhandle= new PDO('sqlite:./datos/galeria.sqlite');
	
	//CREO LA TABLA DE CATEGORIAS
	$dbhandle->exec("CREATE TABLE Categorias(Id INTEGER PRIMARY KEY, NombreC text UNIQUE NOT NULL)");
		
	$dbhandle->exec("INSERT INTO Categorias VALUES(null,'Post-Impresionismo')");

	//CREO LA TABLA DE PINTURAS
	$dbhandle->exec( "CREATE TABLE Pinturas(Id INTEGER PRIMARY KEY," . 
					"NombreP text NOT NULL, Artista text NOT NULL," .
					"Anio integer NOT NULL, Museo text NOT NULL, Imagen text UNIQUE NOT NULL, Likes integer," .
					"Views integer, CId integer NOT NULL)");

	$dbhandle->exec("INSERT INTO Pinturas VALUES(null,'La Noche Estrellada', 'Vicent Van Gogh', 1889, 'The Museum Of Modern Art', '/pintura1.jpg', 0, 0, 1)");
	
	//CREO TABLA DE ETIQUETAS
	$dbhandle->exec("CREATE TABLE Etiquetas(Id INTEGER PRIMARY KEY, PId integer NOT NULL, NombreE text NOT NULL)");
	
	$dbhandle->exec("INSERT INTO Etiquetas VALUES(null, 1, 'noche')");
		
	$dbhandle->exec("INSERT INTO Etiquetas VALUES(null, 1, 'estrellas')");

?>